﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using WiseLink.RDS.Model;

namespace WiseLink.RDS.Web.Controllers.VehicleType
{
    public class VehicleTypeController : Controller
    {
        //
        // GET: /VehicleType/

        private VehicleTypeRepository vehicleTypeRep;
        [HttpPost]
        public ActionResult _GetVehicleManufacture()
        {
            return new JsonResult { Data = new SelectList(vehicleTypeRep.GetVehicleManufacture(), "Value", "Text", new DropDownListItem { Text="AUDI", Value="AUDI"}) };
        }
        [HttpPost]
        public ActionResult _GetVehicleModelForManufacture(string input)
        {
            return new JsonResult { Data = new SelectList(vehicleTypeRep.GetVehicleModelForManufacture(input), "Value", "Text")};
        }
        
        [HttpPost]
        public ActionResult _GetVehicleEngineTypeForManufactureModel(string input)
        {
            return new JsonResult { Data = new SelectList(vehicleTypeRep.GetVehicleEngineTypeForManufactureModel(input), "Value", "Text")};
        }
        
        [HttpPost]
        public ActionResult _GetVehicleModelYearForManufactureModelEngineType(string input)
        {
            return new JsonResult { Data = new SelectList(vehicleTypeRep.GetVehicleModelYearForManufactureModelEngineType(input), "Value", "Text")};
        }
        
        

        public VehicleTypeController()
        {
            vehicleTypeRep = new VehicleTypeRepository();
        }



    }
}
